<template>
  <view>
    <!-- #ifdef APP -->
    <view class="m-2">
      <uni-table :loading="loading" border stripe emptyText="暂无更多数据">
        <uni-tr>
          <uni-th width="100" align="center">姓名</uni-th>
          <uni-th width="100" align="center">职位</uni-th>
          <uni-th width="100" align="center">手机号</uni-th>
        </uni-tr>
        <uni-tr v-for="(item, index) in tableData" :key="index">
          <uni-td align="center">{{
            item.Company_Business_Personnel_Name
          }}</uni-td>
          <uni-td align="center">{{
            item.Company_Business_Personnel_Position
          }}</uni-td>
          <uni-td align="center">{{
            item.Company_Business_Personnel_Phone
          }}</uni-td>
        </uni-tr>
      </uni-table>
    </view>
    <view
      v-for="(item, index) in tableData1"
      :key="item.Company_Address_SerialNumber"
      class="flex flex-column justify-between mx-2 mb-2 content"
      style="height: 300rpx"

    >
      <view>
        <text class="h3 font-weight-bold text-success">{{
          item.Company_Address_Name
        }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >手机号：</text
        >
        <text class="font-md">{{ item.Company_Address_Phone }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >邮编：</text
        >
        <text class="font-md">{{ item.Company_Address_ZipCode }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >地址：</text
        >
        <text class="font-md">{{ item.Company_Address }}</text>
      </view>
    </view>
    <!-- #endif -->
    <!-- #ifdef MP-WEIXIN -->
    <view class="m-2">
      <uni-table :loading="loading" border stripe emptyText="暂无更多数据">
        <uni-tr>
          <uni-th width="100" align="center">姓名</uni-th>
          <uni-th width="100" align="center">职位</uni-th>
          <uni-th width="100" align="center">手机号</uni-th>
        </uni-tr>
        <uni-tr v-for="(item, index) in tableData" :key="index">
          <uni-td align="center">{{
            item.Company_Business_Personnel_Name
          }}</uni-td>
          <uni-td align="center">{{
            item.Company_Business_Personnel_Position
          }}</uni-td>
          <uni-td align="center">{{
            item.Company_Business_Personnel_Phone
          }}</uni-td>
        </uni-tr>
      </uni-table>
    </view>
    <view
      v-for="(item, index) in tableData1"
      :key="item.Company_Address_SerialNumber"
      class="flex flex-column justify-between mx-2 mb-2 content"
      style="height: 300rpx"
    >
      <view>
        <text class="h3 font-weight-bold text-success">{{
          item.Company_Address_Name
        }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >手机号：</text
        >
        <text class="font-md">{{ item.Company_Address_Phone }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >邮编：</text
        >
        <text class="font-md">{{ item.Company_Address_ZipCode }}</text>
      </view>
      <view class="flex">
        <text
          class="flex justify-end flex-shrink font-weight-bold font-md"
          style="width: 20%"
          >地址：</text
        >
        <text class="font-md">{{ item.Company_Address }}</text>
      </view>
    </view>
    <!-- #endif -->
  </view>
</template>

<script>
const app = getApp();
import { getTableInquiry } from "@/api/global.js";
export default {
  data() {
    return {
      tableData: [],
      tableData1: [],
      loading: true,
      form: {
        Data: "company_business_personnel",
        page: 1,
        limit: 999,
      },
      form1: {
        Data: "company_address",
        page: 1,
        limit: 1,
      },
    };
  },
  onLoad() {
    this.getData(this.form, this.form1);
  },
  methods: {
    async getData(data, data1) {
      const res = await getTableInquiry({
        data,
      });
      if (res.Status == "success") {
        console.log(res.tableData);
        this.loading = false;
        this.tableData = res.tableData;
      }
      const res1 = await getTableInquiry({
        data: data1,
      });
      if (res1.Status == "success") {
        console.log(res1.tableData);
        this.tableData1 = res1.tableData;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.content{
  padding: 20rpx;
  box-sizing: border-box;
}
</style>

